<?php

$DB = Antz::registry('db');
global $gCms;

error_reporting(E_ALL);

$this->ThrowConfigExceptions = false;

$dirname = dirname(__FILE__);
$dirname = str_replace(DIRECTORY_SEPARATOR, '/', $dirname);

//$DB->debug(true);
//$DB->showErrors(true);
//$haltInstall = true;

$DB->query('DROP TABLE IF EXISTS '.cms_db_prefix().'isubscribe_config');
$DB->query('DROP TABLE IF EXISTS '.cms_db_prefix().'isubscribe_currencies');
$DB->query('DROP TABLE IF EXISTS '.cms_db_prefix().'isubscribe_subscriptions');
$DB->query('DROP TABLE IF EXISTS '.cms_db_prefix().'isubscribe_subscription_prices');
$DB->query('DROP TABLE IF EXISTS '.cms_db_prefix().'isubscribe_payment_gateways');
$DB->query('DROP TABLE IF EXISTS '.cms_db_prefix().'isubscribe_offsite_payments');
$DB->query('DROP TABLE IF EXISTS '.cms_db_prefix().'isubscribe_users_to_subscriptions');

$DB->query('DROP TABLE IF EXISTS '.cms_db_prefix().'isubscribe_expirations');
$DB->query('DROP TABLE IF EXISTS '.cms_db_prefix().'isubscribe_notifications');
$DB->query('DROP TABLE IF EXISTS '.cms_db_prefix().'isubscribe_notifications_sent');

$this->RemovePermission($this->GetName().' Config');
$this->RemovePermission($this->GetName().' Manage');
$this->RemovePermission($this->GetName().' PHP');
$this->RemovePermission($this->GetName().' Users');

if($haltInstall) exit;
